package cn.ware.house.test;

import cn.ware.house.WareHouseApplication;
import cn.ware.house.interfaces.common.Constants;
import cn.ware.house.interfaces.domain.ids.IIdGenerator;
import cn.ware.house.interfaces.service.inboundservice.InboundOrderService;
import cn.ware.house.interfaces.service.OutboundRecordService;
import cn.ware.house.interfaces.service.inboundservice.impl.InboundProductServiceImpl;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;
import java.util.Map;

/**
 */
@RunWith(SpringRunner.class)
@SpringBootTest(classes = WareHouseApplication.class)
public class ApiTest {

    @Resource
    InboundProductServiceImpl inboundProductService;
    @Resource
    OutboundRecordService outboundRecordService;
    @Resource
    InboundOrderService inboundOrderService;

    @Resource
    private Map<Constants.Ids, IIdGenerator> idGeneratorMap;
    @Test
    public void test_strategy() {
        inboundProductService.getInboundProductsByPage(1,2);
    }

    @Test
    public void test_file(){
        inboundOrderService.getInboundOrdersByPage(1,2);
    //System.out.println(list);
    }
    @Test
    public void test_ids(){
        System.out.println(idGeneratorMap.get(Constants.Ids.SnowFlake).nextId());
    }


}
